<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="<c:url value="/index"></c:url>">论坛系统的实现</a>
        </div>
		<div class="navbar-right" style="margin-right:50px">
        	<c:if test="${not empty user}">
			<h4>
			<!-- Split button -->
          <div class="btn-group">
 <a href="<c:url value="/personal/person"/>"> ${user.nickname} 
					<c:if test="${user.status==0 }">(未激活)</c:if>
				</a>
  <a  style="margin-left: 10px" data-toggle="dropdown" aria-expanded="false">
    <span class="caret"></span>
    <span class="sr-only">Toggle Dropdown</span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li><a href="${path }/personal/resetpassword">修改密码</a></li>
    <li><a href="${path }/personal/upload">上传头像</a></li>
    <li><a href="${path }/personal/mypost">贴子管理</a></li>
    <!-- <li class="divider"></li> -->
   <!--  <li><a href="#">Separated link</a></li> -->
  </ul>
</div>
				<%-- <a href="<c:url value="/personal"/>"> ${user.nickname} 
					<c:if test="${user.status==0 }">(未激活)</c:if>
				</a> --%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<c:url value="/user/logout"></c:url>" class="btn btn-sm btn-warning">退出</a>
			</h4>
			<!-- <button class="btn  btn-primary " type="button" id="login_btn" style="margin-left: 20px;margin-bottom: 10px" onclick="center();">个人中心</button> -->
	</c:if>
	<c:if test="${ empty user}">
			<a href="<c:url value='/login'/>" class="btn  btn-primary" style="margin-left: 20px;margin-top:10px;">登录</a> 
			<a href="<c:url value='/register'/>" class="btn  btn-primary" style="margin-left: 20px;margin-top:10px;">注册</a> 
	</c:if>
		</div>
      </div>
    </nav>
</body>
</html>